#ifndef __SQL_H__
#define __SQL_H__
#include <mysql.h>
#include <server_conf.h>

/*
*create table student (id int(10),name varchar(25),math int(2),chinese int(2))
*insert into student values(20220815,\"Ailon\",10,20)
*delete from student where id=20220001
*update student set id=20220001 where id=20220815
*select * from student where math>0
*MYSQL_ROW row;
*while((row = mysql_fetch_row(res)) !=NULL)
*mysql_free_result(sqlRes);
*/

int sql_create_table(MYSQL *conn, char *query);
int sql_insert(MYSQL *conn, char *query);
int sql_del(MYSQL *conn, char *query);
int sql_edit(MYSQL *conn, char *query);
MYSQL_RES *sql_search(MYSQL *conn, char *query);
//void sql_destroy(MYSQL *conn);
int sql_connPoolInit(void);
void sql_connPoolDestory(void);

extern MYSQL *sqlpool[THREADNUM];

#endif

